----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/table_B4_lessthan3affiliates.log
  log type:  text
 opened on:  16 Dec 2022, 22:08:13

. *-------------------------------------------------------------------------------
. 
. 
. 
. 
. 
. *Number of foreign affiliates with less than 3 affiliates
. *---------------------------------------------------------
. use "${data}/pre_reg0_naics_sales_s1_base_woparent_2016.dta", clear  

. 
. by year sector isocode guo_bvd, sort: gen a=_n==1

. replace a=0 if isocode==hq
(0 real changes made)

. collapse (sum) num_aff=a, by(year sector isocode)

. keep if num_aff<3
(446 observations deleted)

. 
. export delimited using "${rappendix}/table_B4_lessthan3affiliates.csv", datafmt replace
(note: file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/table_B4_lessthan3affiliates.cs
> v not found)
file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/table_B4_lessthan3affiliates.csv saved

. 
. log close 
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/table_B4_lessthan3affiliates.log
  log type:  text
 closed on:  16 Dec 2022, 22:08:14
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
